<?php
include_once("model/HumanModel.php");

class HumanController {
	public $humanrModel;

	public function __construct()
	{
		$this->humanrModel = new HumanModel();
	}
	public function getTourguiderList()
	{
		$result = $this->humanrModel->getTourguiderList();
		include 'view/json/humanview.php';
	}
	public function getTourguiderById($tourguiderId)
	{
		$result = $this->humanrModel->getTourguiderById($tourguiderId);
		include 'view/json/humanview.php';
	}
	public function login($username,$password)
	{
		$results = $this->humanrModel->checkLogin($username, $password);
		include 'view/json/checklogin.php';
	}
	public  function inserthuman($name,$username, $password,$age,$phone,$imagelink,$latitude,$longitude,$tourcode,$uuid,$type)
	{
		$result = $this->humanrModel->inserthuman($name,$username, $password,$age,$phone,$imagelink,$latitude,$longitude,$tourcode,$uuid,$type);
		include 'view/json/humanview.php';
	}
	public function uploadImage(){
// 		$uploaddir = './uploads/';
// 		$file = basename($_FILES['userfile']['name']);
// 		$uploadfile = $uploaddir . $file;
		
// 		if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
// 			echo "http://tranquangdieu.org/vu/tourguide/uploads/{$file}";
// 		}
		$result = "xxx";
// 		echo "xxx";
		include 'view/json/humanview.php';
	}
}

?>